﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LotteryVote.Entity;

namespace LotteryVote.Controls
{
    public partial class PlayWayDropDownList : System.Web.UI.UserControl
    {
        public int SelectedIndex
        {
            get
            {
                return ddl_playway.SelectedIndex;
            }
        }
        public string SelectedValue
        {
            get
            {
                return ddl_playway.SelectedValue;
            }
        }
        public string SelectedText
        {
            get
            {
                return ddl_playway.SelectedItem.Text;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                BindSelectContent();
        }
        void BindSelectContent()
        {
            ddl_playway.Items.Add(new ListItem(GetLocalResourceObject("all").ToString(), "all"));
            foreach (var gameType in Enum.GetNames(typeof(PlayWayEnum)))
            {
                ddl_playway.Items.Add(new ListItem(GetLocalResourceObject(gameType).ToString(), gameType));
            }
        }
    }
}